﻿using IceDog.Uop.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IceDog.Uop.Models
{
    public class Product
    {
        public Product()
        {
            Guid = GUIDHelper.GuidString;
            JoinDate = DateTime.Now;
        }
        /// <summary>
        /// 产品Id
        /// <para>[可以不用赋值，内部赋值]</para>
        /// </summary>
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]//主键，自动递增
        public int Id { get; set; }
        /// <summary>
        /// 产品Guid
        /// <para>[可以不用赋值，内部赋值]</para>
        /// </summary>
        public string Guid { get; set; }
        /// <summary>
        /// 产品编号
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 产品录入时间
        /// <para>[可以不用赋值，内部赋值]</para>
        /// </summary>
        public DateTime JoinDate { get; set; }

        /// <summary>
        /// 每千克单价
        /// </summary>
        public decimal UnitPricePerKg { get; set; }
        /// <summary>
        /// 来源地址(省市区县)
        /// </summary>
        public string FromAddress { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 订单产品集合
        /// </summary>
        public IList<OrderDetail> OrderDetails { get; set; }

    }
}
